import Vue from 'vue'
import store from '@/store/index'

Vue.directive('roleBtn', {
  inserted: function (el, binding) {
    const roleArr = binding.value
    const userRole = store.getters && store.getters.roles
    if (roleArr && roleArr.indexOf(userRole) !== -1) {
      return false
    } else {
      el.parentNode.removeChild(el)
    }
  }
})
